package com.nakamachizu.meta;

//@javax.annotation.Generated(value = { "slim3-gen", "EA1-SNAPSHOT" }, date = "2010-03-09 17:58:36")
/** */
public final class LandMarkDataMeta extends org.slim3.datastore.ModelMeta<com.nakamachizu.model.LandMarkData> {

    /** */
    public final org.slim3.datastore.StringAttributeMeta<com.nakamachizu.model.LandMarkData> comment = new org.slim3.datastore.StringAttributeMeta<com.nakamachizu.model.LandMarkData>(this, "comment", "comment");

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<com.nakamachizu.model.LandMarkData, java.util.Date> entryDate = new org.slim3.datastore.CoreAttributeMeta<com.nakamachizu.model.LandMarkData, java.util.Date>(this, "entryDate", "entryDate", java.util.Date.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<com.nakamachizu.model.LandMarkData, com.google.appengine.api.datastore.Key> key = new org.slim3.datastore.CoreAttributeMeta<com.nakamachizu.model.LandMarkData, com.google.appengine.api.datastore.Key>(this, "__key__", "key", com.google.appengine.api.datastore.Key.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<com.nakamachizu.model.LandMarkData, com.google.appengine.api.datastore.GeoPt> latLng = new org.slim3.datastore.CoreAttributeMeta<com.nakamachizu.model.LandMarkData, com.google.appengine.api.datastore.GeoPt>(this, "latLng", "latLng", com.google.appengine.api.datastore.GeoPt.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<com.nakamachizu.model.LandMarkData> mIconName = new org.slim3.datastore.StringAttributeMeta<com.nakamachizu.model.LandMarkData>(this, "mIconName", "mIconName");

    /** */
    public final org.slim3.datastore.ModelRefAttributeMeta<com.nakamachizu.model.LandMarkData, org.slim3.datastore.ModelRef<com.nakamachizu.model.MapData>, com.nakamachizu.model.MapData> mapDataRef = new org.slim3.datastore.ModelRefAttributeMeta<com.nakamachizu.model.LandMarkData, org.slim3.datastore.ModelRef<com.nakamachizu.model.MapData>, com.nakamachizu.model.MapData>(this, "mapDataRef", "mapDataRef", org.slim3.datastore.ModelRef.class, com.nakamachizu.model.MapData.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<com.nakamachizu.model.LandMarkData> markType = new org.slim3.datastore.StringAttributeMeta<com.nakamachizu.model.LandMarkData>(this, "markType", "markType");

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<com.nakamachizu.model.LandMarkData, java.util.Date> modifyDate = new org.slim3.datastore.CoreAttributeMeta<com.nakamachizu.model.LandMarkData, java.util.Date>(this, "modifyDate", "modifyDate", java.util.Date.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<com.nakamachizu.model.LandMarkData> name = new org.slim3.datastore.StringAttributeMeta<com.nakamachizu.model.LandMarkData>(this, "name", "name");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<com.nakamachizu.model.LandMarkData> pcIconName = new org.slim3.datastore.StringAttributeMeta<com.nakamachizu.model.LandMarkData>(this, "pcIconName", "pcIconName");

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<com.nakamachizu.model.LandMarkData, java.lang.Integer> schemaVersion = new org.slim3.datastore.CoreAttributeMeta<com.nakamachizu.model.LandMarkData, java.lang.Integer>(this, "schemaVersion", "schemaVersion", java.lang.Integer.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<com.nakamachizu.model.LandMarkData, java.lang.Long> version = new org.slim3.datastore.CoreAttributeMeta<com.nakamachizu.model.LandMarkData, java.lang.Long>(this, "version", "version", java.lang.Long.class);

    private static final LandMarkDataMeta singleton = new LandMarkDataMeta();

    /**
     * @return the singleton
     */
    public static LandMarkDataMeta get() {
       return singleton;
    }

    /** */
    public LandMarkDataMeta() {
        super("MarkData", com.nakamachizu.model.LandMarkData.class, java.util.Arrays.asList("com.nakamachizu.model.LandMarkData"));
    }

    @Override
    public com.nakamachizu.model.LandMarkData entityToModel(com.google.appengine.api.datastore.Entity entity) {
        com.nakamachizu.model.LandMarkData model = new com.nakamachizu.model.LandMarkData();
        model.setComment((java.lang.String) entity.getProperty("comment"));
        model.setEntryDate((java.util.Date) entity.getProperty("entryDate"));
        model.setKey(entity.getKey());
        model.setLatLng((com.google.appengine.api.datastore.GeoPt) entity.getProperty("latLng"));
        model.setMIconName((java.lang.String) entity.getProperty("mIconName"));
        if (model.getMapDataRef() == null) {
            throw new NullPointerException("The property(mapDataRef) is null.");
        }
        model.getMapDataRef().setKey((com.google.appengine.api.datastore.Key) entity.getProperty("mapDataRef"));
        model.setMarkType((java.lang.String) entity.getProperty("markType"));
        model.setModifyDate((java.util.Date) entity.getProperty("modifyDate"));
        model.setName((java.lang.String) entity.getProperty("name"));
        model.setPcIconName((java.lang.String) entity.getProperty("pcIconName"));
        model.setSchemaVersion(longToInteger((java.lang.Long) entity.getProperty("schemaVersion")));
        model.setVersion((java.lang.Long) entity.getProperty("version"));
        return model;
    }

    @Override
    public com.google.appengine.api.datastore.Entity modelToEntity(java.lang.Object model) {
        com.nakamachizu.model.LandMarkData m = (com.nakamachizu.model.LandMarkData) model;
        com.google.appengine.api.datastore.Entity entity = null;
        if (m.getKey() != null) {
            entity = new com.google.appengine.api.datastore.Entity(m.getKey());
        } else {
            entity = new com.google.appengine.api.datastore.Entity(kind);
        }
        entity.setProperty(CLASS_HIERARCHY_LIST_RESERVED_PROPERTY, classHierarchyList);
        entity.setProperty("comment", m.getComment());
        entity.setProperty("entryDate", m.getEntryDate());
        entity.setProperty("latLng", m.getLatLng());
        entity.setProperty("mIconName", m.getMIconName());
        if (m.getMapDataRef() == null) {
            throw new NullPointerException("The property(mapDataRef) must not be null.");
        }
        entity.setProperty("mapDataRef", org.slim3.datastore.ModelMeta.assignKeyIfNecessary(m.getMapDataRef().getModelMeta(), m.getMapDataRef().getModel()));
        entity.setProperty("markType", m.getMarkType());
        entity.setProperty("modifyDate", m.getModifyDate());
        entity.setProperty("name", m.getName());
        entity.setProperty("pcIconName", m.getPcIconName());
        entity.setProperty("schemaVersion", m.getSchemaVersion());
        entity.setProperty("version", m.getVersion());
        return entity;
    }

    @Override
    protected com.google.appengine.api.datastore.Key getKey(Object model) {
        com.nakamachizu.model.LandMarkData m = (com.nakamachizu.model.LandMarkData) model;
        return m.getKey();
    }

    @Override
    protected void setKey(Object model, com.google.appengine.api.datastore.Key key) {
        validateKey(key);
        com.nakamachizu.model.LandMarkData m = (com.nakamachizu.model.LandMarkData) model;
        m.setKey(key);
    }

    @Override
    protected long getVersion(Object model) {
        com.nakamachizu.model.LandMarkData m = (com.nakamachizu.model.LandMarkData) model;
        return m.getVersion() != null ? m.getVersion().longValue() : 0L;
    }

    @Override
    protected void incrementVersion(Object model) {
        com.nakamachizu.model.LandMarkData m = (com.nakamachizu.model.LandMarkData) model;
        long version = m.getVersion() != null ? m.getVersion().longValue() : 0L;
        m.setVersion(Long.valueOf(version + 1L));
    }

}